<template>
	<view class="map-box">

			<view style="padding: 20px">
					<view class="">地址：{{ title }}</view>
					<view class="">详细地址：{{ address }}</view>
					<view class="">经度：{{ longitude }}</view>
					<view class="">纬度：{{ latitude }}</view>
			</view>
			<view style="width: 90vw; margin: 5vw">
					<button @click="onClick">点击打开地图</button>
			</view>
			<atl-map :disable="disable" v-if="show" :longitude="longitude" :latitude="latitude" :marker="marker" :mapKey="mapKey" :mapType="mapType" @confirm="confirm">
					<template v-slot:content>
							<view style="position: absolute; bottom: 0; width: 100%; height: 24px; background-color: white">
									<view style="display: flex; align-items: center; justify-content: center">
											<image style="width: 24px; height: 24px" :src="imageSrc"></image>
											<text>内容插槽</text>
									</view>
							</view>
					</template>
			</atl-map>

		<!-- <map-Point @commitCheck="commitCheck" :mapKey='mapKey' :Radius='Radius' :showResetting='showResetting' :listIco='listIco' :orientationIco='orientationIco' :resettingIco='resettingIco' :configData='configData'></map-Point> -->
	</view>
</template>

<script>

	
export default {
	data() {
		return {
			mapKey:'95d3a4d14e91e40e2fbb38c8ec236d6d',
			mapType: 'amap' ,// tmap bmap amap
			disable: false,
			show: false,
			title: '',
			
			latitude: '',
			longitude: '',
			address: '',
			imageSrc: '/static/logo.png', //自定义图片
			marker: {
					id: 1,
					height: 50,
					width: 40
					// iconPath: '/static/comm/position.png'
			},
			
			listIco:'/uni_modules/map-Point/static/item-inx.png',
			orientationIco:'/uni_modules/map-Point/static/map-inx.png',
			resettingIco:"/uni_modules/map-Point/static/position.png",
			showResetting:true,
			Radius:'',
			// 微信公众号jsSdk配置
			configData:{
				debug:false,// 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
				appId:'',// 必填，公众号的唯一标识
				timestamp: '', // 必填，生成签名的时间戳
				nonceStr: '', // 必填，生成签名的随机串
				signature: '', // 必填，签名
			}
		};
	},
	methods: {
		commitCheck(e) {
			console.log(e, 565);
			uni.$emit('commitCheck', e);
			uni.navigateBack({
				delta: 1
			});
		},
		
		onClick() {
			// this.show = true;
			// 跳转到地图页面
			uni.navigateTo({
				url: '/pages/map/demo'
			});
		},
		confirm(e) {
			if (e) {
				this.longitude = e.longitude;
				this.latitude = e.latitude;
				this.title = e.title;
				this.address = e.address;
			}
			this.show = false;
		}
	}
};
</script>

<style lang="scss">
.map-box {
	height: 100vh;
	width: 100vw;
}
</style>
